#ifndef UDPSERVERTHREAD_H
#define UDPSERVERTHREAD_H

#include <QThread>
#include <QtNetwork/QUdpSocket>

class UdpServerThread : public QThread
{
    Q_OBJECT
public:
    explicit UdpServerThread(QObject *parent = nullptr, quint16 port = 1234);

signals:
    void datagramReceived(const QByteArray &datagram, const QHostAddress &sender, quint16 senderPort);

private slots:
    void readPendingDatagrams();

protected:
    /*
    void run() override;
*/

private:
    quint16 port;
    QUdpSocket *socket;
};


#endif // UDPSERVERTHREAD_H
